package com.example.ssm.service.impl;

import com.example.ssm.mapper.BaseDictMapper;
import com.example.ssm.pojo.BaseDict;
import com.example.ssm.pojo.BaseDictExample;
import com.example.ssm.service.IBaseDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("baseDictServcie")
public class BaseDictServiceImpl implements IBaseDictService
{
    @Autowired
    private BaseDictMapper baseDictMapper;

    @Override
    public List<BaseDict> queryBaseDictByDictTypeCode(String dictTypeCode)
    {
        // 查询条件
        BaseDictExample baseDictExample = new BaseDictExample();
        BaseDictExample.Criteria criteria = baseDictExample.createCriteria();
        // dict_type_code == dictTypeCode
        criteria.andDictTypeCodeEqualTo(dictTypeCode);

        return baseDictMapper.selectByExample(baseDictExample);
    }
}
